/**
 * @SameLogConsole.as
 * 
 * @author sodaChen mail:asframe@qq.com
 * @version 1.0
 * <br>Copyright (C), 2010-2015 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:ASFrame Log
 * <br>Date:2016-4-28
 */
package com.asframe.log.console
{
	import com.asframe.log.ILogConsole;
	import com.asframe.log.Level;
	
	/**
	 * 支持多个日志输出对象
	 * @author sodaChen
	 * Date:2016-4-28
	 */
	public class SameLogConsole implements ILogConsole
	{
		private var logConsoles:Vector.<ILogConsole>;
		private var logCount:int;
		public function SameLogConsole()
		{
			logConsoles = new Vector.<ILogConsole>();
		}
		/**
		 * 添加一个新的日志输出对象
		 * @param logConsole
		 * 
		 */		
		public function addLogConsole(logConsole:ILogConsole):void
		{
			logConsoles.push(logConsole);
			logCount = logConsoles.length;
		}
		
		public function console(level:Level, target:Object, logs:Array):void
		{
			for (var i:int = 0; i < logCount; i++) 
			{
				logConsoles[i].console(level,target,logs);
			}
		}
	}
}